#ifndef __MCS__VARIABLE_DECLARATION__HPP
#define __MCS__VARIABLE_DECLARATION__HPP

#include "Element.hpp"
#include "VariableDeclarationList.hpp"

class VariableDeclaration : public Element
{
public:
	VariableDeclaration(SourceLocation const & location, Value::DataType dataType, ptr<VariableDeclarationList> vars)
		: Element(location)
		, dataType_(dataType)
		, vars_(vars)
	{}

	virtual void init(Block * parentBlock)
	{
		Element::init(parentBlock);
		vars_->init(dataType_, parentBlock);
	}

	virtual void execute() const
	{
		vars_->create();
	}
private:
	Value::DataType dataType_;
	ptr<VariableDeclarationList> vars_;
};

#endif //__MCS__VARIABLE_DECLARATION__HPP
